const path = require('path')
module.exports = {
    entry: './index.js',
    output: {
        filename: "index.js",
        path: path.resolve(__dirname, 'dist'),
    },
    module: {
        rules: [
            
            {
                test: /\.css$/i, //下载npm install -D css-loader style-loader
                use: [
                    'style-loader',
                    {
                        loader: 'css-loader',
                        options: {
                            importLoaders:1,//默认是0 1则表示css里面中 有引入的import 再次进行postcss-loader
                        }
                    },
                ]
            },
            //处理图标
            {
                //webpack5不需要使用file-loading url-loader等 有自带的功能
                test: /\.(ttf|woff2?|gif)/,
                type: 'asset/resource',
                  generator: {//处理图片路径
                    filename:"font/[name].[hash:10][ext]"
                },
            },
    
        ]
    },
}